<%--
  Created by IntelliJ IDEA.
  User: zhaoyang
  Date: 2020/8/3
  Time: 10:43 上午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>接受注册信息</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    String ip = request.getRemoteHost();
    String name = request.getParameter("username");
    String pwd = request.getParameter("password");
    String age = request.getParameter("age");
    int age2 = new Integer(age);
    String[] hobbys = request.getParameterValues("hobby");
%>
<div>
    <%
        out.println("IP：" + ip + "</br>");
        out.println("姓名：" + name + "</br>");
        out.println("密码：" + pwd + "</br>");
        out.println("年龄：" + age2 + "</br>");
        out.println("爱好：");
        if (hobbys != null && hobbys.length > 0) {
            for (String h : hobbys) {
                out.println(h + "</br>");
            }
        } else {
            out.println("未填写爱好！</br>");
        }
    %>

</div>
</body>
</html>
